package cn.kgc.tafang.dao;

import cn.kgc.tafang.entity.*;
import cn.kgc.tafang.service.UserOpera;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Init {
    public static Map<String,User> users=new HashMap();
    public static Map<String, Arms> armsHashMap=new HashMap<>();
    public static Map<String, Skill> skillHashMap=new HashMap<>();
    public static Map<String, Hero> heroMap=new HashMap<>();
    public static List<Tower> towerList=new ArrayList<>();
    public static List<Moster> mosterList=new ArrayList<>();
    public static List<JinYinMoster> jinYinMosterList=new ArrayList<>();
    public static List<Boss> bosses=new ArrayList<>();
    static File file=new File("aaa.txt");
    /**
     * 初始化英雄信息
     */
    static {
        Hero hero=new Hero(null,1,60,null,30,0,100,100,0,
        1,0,null,null,null);
        heroMap.put(hero.getName(),hero);
    }
    /**
     * 初始化防御塔信息
     */
    static {
        Tower tower=new Tower(1,50,200,1000,200);
        towerList.add(tower);
    }
    /**
     * 初始化用户信息
     */
    static {
        User user = new User("admin","123456");
        users.put(user.getName(),user);
        if (file.length()==0){
            UserOpera.Seria(users,file);
        }
    }
    /**
     * 初始化武器信息
     */
    static {
        Arms arms=new Arms("短剑",5,0,5);
        armsHashMap.put(arms.getName(),arms);
    }
    /**
     * 初始化技能信息
     */
    static {
        Skill skill =new Skill(null,0,0,0);
        skillHashMap.put(skill.getName(),skill);
        Skill Gongji=new Skill("击退",30,0,0);
        Skill JiTui=new Skill("控制",0,5,0);
        Skill HuiFu=new Skill("回复",0,0,150);
        skillHashMap.put(skill.getName(),Gongji);
        skillHashMap.put(skill.getName(),JiTui);
        skillHashMap.put(skill.getName(),HuiFu);
    }
    /**
     * 初始化怪物信息
     */
    static {
        Moster moster = new Moster("普通兵",1,10,10,50,5);
        mosterList.add(moster);
    }
    /**
     * 初始化精英怪信息
     */
    static {
        JinYinMoster jinYinMoster=new JinYinMoster(null,0,0,0,0,0);
        jinYinMosterList.add(jinYinMoster);
    }
    /**
     * 初始化boss信息
     */
    static {
        Boss boss=new Boss(null,0,0,0,0,0);
        bosses.add(boss);
    }
}
